from fastapi import APIRouter, Depends, Request
from app.api.h5.schema.order.order import OrderAppCancleInSchema, OrderAppListInSchema, OrderDetailInSchema,  OrderInSchema, OrderListInSchema
from app.api.h5.service.order.order import OrderService
from app.utils.res import unified_resp


cancel_app = APIRouter(prefix="/cancel_app", tags=["订单"])




@cancel_app.post("/app_list")
@unified_resp
async def app_list(app_list_in: OrderAppListInSchema, order_service: OrderService = Depends(OrderService.instance)):
    return await order_service.app_list(app_list_in)


@cancel_app.post("/app_cancel")
@unified_resp
async def app_cancel(cancel_in: OrderAppCancleInSchema, order_service: OrderService = Depends(OrderService.instance)):
    return await order_service.app_cancel(cancel_in)


@cancel_app.post("/app_statistics")
@unified_resp
async def app_statistics(order_service: OrderService = Depends(OrderService.instance)):
    return await order_service.app_statistics()